SetForegroundWindow (coredll)
Last changed: -41.196.238.118

.
Summary
SetForegroundWindow() - Moves the window associated with the passed handle to the front.

C# Signature:

[DllImport("user32.dll"]
private static extern bool SetForegroundWindow (IntPtr hWnd);

VB Signature:

Declare Function SetForegroundWindow Lib "user32.dll" (hWnd as IntPtr) As Boolean

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

[DllImport ("user32.dll")]
private static extern bool SetForegroundWindow (IntPtr hWnd);

[DllImport ("user32.dll")]
private static extern IntPtr GetDesktopWindow ();

private void SendToBack ()
{
    SetForegroundWindow (GetDesktopWindow ());
}

Documentation